<template>
	<view class="pad-16r">
		<view class="bg-white pad-10">
			<view class="eval-title">评价护士</view>
			<view class="eval-doctor">
				<view class="pad-10">
					<image v-if="doctorItem.doctorHead" class="eval-img" :src="hostApi+doctorItem.doctorHead"></image>
					<image v-else class="eval-img" src="/static/images/hospital/defaultDoctor.png"></image>
				</view>
				<view class="center">
					<view>
						<view class="font-size-20">{{doctorItem.doctorName}}
							<text v-if="doctorItem.jobTitle">({{doctorItem.jobTitle}})</text>
						</view>
						<view class="color-gray mar-5-0">{{doctorItem.departmentName}}</view>
					</view>
				</view>
			</view>
		</view>
		<view class="section-card">
			<view class="pad-10 thime-color first-title color-white"> <strong>内容介绍</strong></view>
			<view class="call-padding">
				<view class="thime-color color-white text-center title pad-5 radius-5">
					肌肉/皮下注射
				</view>
				<view class="value">
					执行护士根据医嘱和患者需求提供相关护理技术服务，将摇曳注入肌肉组织或皮下组织，达到治疗疾病的目的。
				</view>
			</view>
		</view>

		<view class="section-card">
			<view class="pad-10 thime-color first-title color-white"> <strong>服务信息</strong></view>
			<view class="call-padding">
				<view class="top-box">
					<view class="">
						皮下注射
					</view>
					<view class="color-gray">
						<view class="flex-start">
							<view>服务态度</view>
							<u-rate active-color="#FA3534" inactive-color="#b2b2b2" gutter="20"
								v-model="form.fractionServe"></u-rate>
						</view>
						<view class="flex-start">
							<view>专业水平</view>
							<u-rate active-color="#FA3534" inactive-color="#b2b2b2" gutter="20"
								v-model="form.fractionSpeciality"></u-rate>
						</view>
						<view class="flex-start">
							<view>信息告知</view>
							<u-rate active-color="#FA3534" inactive-color="#b2b2b2" gutter="20"
								v-model="form.fractionInfo"></u-rate>
						</view>
						<view class="flex-start">
							<view>响应速度</view>
							<u-rate active-color="#FA3534" inactive-color="#b2b2b2" gutter="20"
								v-model="form.fractionSpeed"></u-rate>
						</view>
					</view>

				</view>
			</view>

			<view class="call-padding">
				<view class="top-box">
					<view class="">
						肌肉注射
					</view>
					<view class="color-gray">
						<view class="flex-start">
							<view>服务态度</view>
							<u-rate active-color="#FA3534" inactive-color="#b2b2b2" gutter="20"
								v-model="form2.fractionServe"></u-rate>
						</view>
						<view class="flex-start">
							<view>专业水平</view>
							<u-rate active-color="#FA3534" inactive-color="#b2b2b2" gutter="20"
								v-model="form2.fractionSpeciality"></u-rate>
						</view>
						<view class="flex-start">
							<view>信息告知</view>
							<u-rate active-color="#FA3534" inactive-color="#b2b2b2" gutter="20"
								v-model="form2.fractionInfo"></u-rate>
						</view>
						<view class="flex-start">
							<view>响应速度</view>
							<u-rate active-color="#FA3534" inactive-color="#b2b2b2" gutter="20"
								v-model="form2.fractionSpeed"></u-rate>
						</view>
					</view>

				</view>
				
			</view>
		</view>
		<ButtonVue content="提交" @click="confirm"></ButtonVue>
	</view>
</template>

<script>
	import ButtonVue from '../../components/Button/Button.vue';
	import {
		selectDoctorEvaluate,
		doctorEvaluateAdd
	} from '../../api/doctorEvaluate';
	import {
		mapGetters
	} from 'vuex'
	export default {
		components: {
			ButtonVue,
		},
		onLoad(e) {
			this.doctorItem = JSON.parse(e.item)
		},
		data() {
			return {
				doctorItem: {},
				form: {
					fraction: 0,
					fractionServe: 0,
					fractionSpeciality: 0,
					fractionInfo: 0,
					fractionSpeed: 0,
					describe: ''
				},
				form2: {
					fraction: 0,
					fractionServe: 0,
					fractionSpeciality: 0,
					fractionInfo: 0,
					fractionSpeed: 0,
					describe: ''
				},
				list: ["医术高超", "和蔼可亲", "服务高效"],
				typeVal: '皮下注射',
				nursingItem: [{
					name: '家庭护理出诊费(含保险)',
					price: '128.00'
				}, {
					name: '交通费',
					price: '30.00'
				}, {
					name: '耗材费',
					price: '7.50'
				}, ]
			}
		},
		computed: {
			...mapGetters(['hostApi', "userInfo"])
		},

		mounted() {

		},
		methods: {
			confirm() {
				if (!this.form.describe) {
					this.$u.toast('请输入评价内容');
					return
				}
				this.form.doctorCode = this.doctorItem.doctorCode
				this.form.doctorName = this.doctorItem.doctorName
				this.form.status = 1
				this.form.patId = this.userInfo.patId
				this.form.patName = this.userInfo.patName
				this.form.patHeadImg = this.userInfo.patHeadImg
				this.form.payOrderNo = this.doctorItem.payOrderNo
				doctorEvaluateAdd(this.form).then(res => {
					uni.navigateBack(1)

				})
			},
			changeFast(item) {
				this.form.describe = item;
			}
		}
	}
</script>

<style scoped>
	.eval-title {
		border-left: 3px solid blue;
		padding: 0 10px;
		margin: 10px 0;
	}

	.eval-doctor {
		background-color: rgb(235, 242, 255);
		display: flex;
		justify-content: flex-start;
		border-radius: 16rpx;
	}

	.eval-img {
		width: 70px;
		height: 70px;
		border-radius: 90px;
	}

	.fraction {
		background-color: white;
		border-radius: 16rpx;
		margin: 10px 0;
		padding: 16rpx;
	}

	.fraction-title {
		margin: 10px 0;
		font-size: 16px;
	}

	.item {
		padding: 5px 10px;
		background-color: rgb(242, 242, 242);
		margin: 10px;
		border-radius: 16px;
	}

	.section-card {
		background: #fff;
		margin: 25rpx;
		box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);

		border: 1px solid #e6e6e6;
		border-radius: 5px;

	}

	.top-box {
		display: flex;
		justify-content: space-between;
	}

	.item-box1 {
		display: flex;
		flex-direction: column;
	}

	.call-padding {
		padding: 24rpx 32rpx 18rpx 32rpx;
	}

	.item-box2 {

		position: relative;
		left: 20px;
	}

	.price-box {
		position: relative;
		left: 15px;
	}

	.title {
		margin-top: 10px;
		margin-bottom: 10px;
		font-size: 15px;
		width: 240rpx
	}

	.value {
		color: #888;
		font-size: 28rpx;
	}

	.thime-color {
		background-color: rgb(53, 166, 175);
	}

	.first-title {
		border-top-right-radius: 5px;
		border-top-left-radius: 5px;
	}

	.btn-color {
		background-color: #A4F5FC;
	}

	.line-btn {
		background: #fff;
		color: #1ec6e6;
		border: 1rpx solid #1ec6e6;
		text-align: center;
	}

	.thime-btn {
		margin-top: 20px;
		width: 40%;
	}
</style>